import {LESSON_SERVER_AXIOS} from '@/api/axios';
import {jsonToQs} from "@/constant";

// GET - 查询购物车记录: 查询个人全部购物车记录
export const LIST = () => LESSON_SERVER_AXIOS.get("/cart/list");
// POST - 添加购物车记录: 向Redis中添加一条购物车记录，重复添加视为修改
export const INSERT = (params) => LESSON_SERVER_AXIOS.post("/cart/insert", params);
// POST - 批删购物车记录: 按视频主键数组，批量删除个人的购物车记录
export const BATCH_DELETE = (params) => LESSON_SERVER_AXIOS.post("/cart/batchDelete?" + jsonToQs(params));
// POST - 清空购物车记录: 清空个人全部购物车记录
export const CLEAR = (params) => LESSON_SERVER_AXIOS.post("/cart/clear", params);